
'
' *  NHibernate 代码模版
' 

Imports System.Collections.Generic

Namespace NCS
	''' <summary>
	'''	
	''' </summary>
	<Serializable()> _
	Public Class netSet

		#Region "构造方法"
		Public Sub New()
			m_ip = Nothing
			m_port = 0
			m_prot = False

			m_id = 0
		End Sub
		#End Region


		#Region "私有变量"
		Private m_ip As String
		Private m_port As Integer
		Private m_prot As Boolean
		Private m_id As Integer

		#End Region


		#Region "公有属性"

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property ip() As String
			Get
				Return m_ip
			End Get
			Set
				m_ip = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property port() As Integer
			Get
				Return m_port
			End Get
			Set
				m_port = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property prot() As Boolean
			Get
				Return m_prot
			End Get
			Set
				m_prot = value
			End Set
		End Property

		'''<summary>
		'''
		'''</summary>
		Public Overridable Property id() As Integer
			Get
				Return m_id
			End Get
			Set
				m_id = value
			End Set
		End Property

		#End Region

		#Region "Rewrite Equals and HashCode"
		''' <summary>
		''' 
		''' </summary>
		Public Overloads Overrides Function Equals(obj As Object) As Boolean
			If Me Is obj Then
				Return True
			End If
			If (obj Is Nothing) OrElse (obj.[GetType]() IsNot [GetType]()) Then
				Return False
			End If
			Dim castObj As netSet = DirectCast(obj, netSet)
			Return (castObj IsNot Nothing) AndAlso (m_id = castObj.id)
		End Function
		''' <summary>
		''' 用唯一值实现GetHashCode
		''' </summary>
		Public Overloads Overrides Function GetHashCode() As Integer
			Dim hash As Integer = 57
			hash = 27 * hash * m_id.GetHashCode()
			Return hash
		End Function
		#End Region
	End Class
End Namespace
